The process of rendering two-dimensional images from three-dimensional scenes is commonly referred to as image processing. As the modern computer industry evolves image processing evolves as well. One particular goal in the evolution of image processing is to make two-dimensional simulations or renditions of three-dimensional scenes as realistic as possible. One limitation of rendering realistic images is that modern monitors display images through the use of pixels.
A pixel is the smallest area of space which can be illuminated on a monitor. Most modern computer monitors will use a combination of hundreds of thousands or millions of pixels to compose the entire display or rendered scene. The individual pixels are arranged in a grid pattern and collectively cover the entire viewing area of the monitor. Each individual pixel may be illuminated to render a final picture for viewing.
One technique for rendering a real world three-dimensional scene onto a two-dimensional monitor using pixels is called rasterization. Rasterization is the process of taking a two-dimensional image represented in vector format (mathematical representations of geometric objects within a scene) and converting the image into individual pixels for display on the monitor. Rasterization is effective at rendering graphics quickly and using relatively low amounts of computational power; however, rasterization suffers from several drawbacks. For example, rasterization often suffers from a lack of realism because it is not based on the physical properties of light, rather rasterization is based on the shape of three-dimensional geometric objects in a scene projected onto a two dimensional plane. Furthermore, the computational power required to render a scene with rasterization scales directly with an increase in the complexity of the scene to be rendered. As image processing becomes more realistic, rendered scenes also become more complex. Therefore, rasterization suffers as image processing evolves, because rasterization scales directly with complexity.
Several alternative techniques rendering a real world three-dimensional scene onto a two-dimensional monitor using pixels have been developed based upon more realistic physical modeling. One such physical rendering technique is called ray tracing. The ray tracing technique traces the propagation of imaginary rays, rays which behave similar to rays of light, into a three-dimensional scene which is to be rendered onto a computer screen. The rays originate from the eye(s) of a viewer sitting behind the computer screen and traverse through pixels, which make up the computer screen, towards the three-dimensional scene. Each traced ray proceeds into the scene and may intersect with objects within the scene. If a ray intersects an object within the scene, properties of the object and several other contributing factors are used to calculate the amount of color and light, or lack thereof, the ray is exposed to. These calculations are then used to determine the final color of the pixel through which the traced ray passed.
The process of tracing rays is carried out many times for a single scene. For example, a single ray may be traced for each pixel in the display. Once a sufficient number of rays have been traced to determine the color of all of the pixels which make up the two-dimensional display of the computer screen, the two dimensional synthesis of the three-dimensional scene can be displayed on the computer screen to the viewer.
Ray tracing typically renders real world three-dimensional scenes with more realism than rasterization. This is partially due to the fact that ray tracing simulates how light travels and behaves in a real world environment, rather than simply projecting a three-dimensional shape onto a two dimensional plane as is done with rasterization. Therefore, graphics rendered using ray tracing more accurately depict on a monitor what our eyes are accustomed to seeing in the real world.
Furthermore, ray tracing also handles increases in scene complexity better than rasterization as scenes become more complex. Ray tracing scales logarithmically with scene complexity. This is due to the fact that the same number of rays may be cast into a scene, even if the scene becomes more complex. Therefore, ray tracing does not suffer in terms of computational power requirements as scenes become more complex as rasterization does.
One major drawback of ray tracing, however, is the large number of calculations, and thus processing power, required to render scenes. This leads to problems when fast rendering is needed. For example, when an image processing system is to render graphics for animation purposes such as in a game console. Due to the increased computational requirements for ray tracing it is difficult to render animation quickly enough to seem realistic (realistic animation is approximately twenty to twenty-four frames per second).
With continued improvements in semiconductor technology in terms of clock speed and increased use of parallelism; however, real time rendering of scenes using physical rendering techniques such as ray tracing becomes a more practical alternative to rasterization. At the chip level, multiple processor cores are often disposed on the same chip, functioning in much the same manner as separate processor chips, or to some extent, as completely separate computers. In addition, even within cores, parallelism is employed through the use of multiple execution units that are specialized to handle certain types of operations. Hardware-based pipelining is also employed in many instances so that certain operations that may take multiple clock cycles to perform are broken up into stages, enabling other operations to be started prior to completion of earlier operations. Multithreading is also employed to enable multiple instruction streams to be processed in parallel, enabling more overall work to performed in any given clock cycle.
Despite these advances, however, the adoption of physical rendering techniques faces a number of challenges. One such challenge relates to the manner in which physical rendering techniques are capable of harnessing parallelization to improve performance.
In general, rendering processes often can be logically broken into frontend and backend processes. The frontend process is used to basically build primitives for a scene to be depicted in the displayed image. A primitive is the basic geometry element used to represent an object in a scene, and in many conventional techniques, primitives are defined as triangles. Objects to be placed in a scene may be predefined and loaded during the frontend process, or objects can be built on-the-fly based upon mathematical algorithms that define the shape of a 3D object.
The frontend process typically places objects in a scene, determines and/or creates the primitives for those objects, and assigns colors or textures to each of the primitives. Once objects and primitives are placed, no movement of those objects or primitives is typically permitted.
The backend process takes the primitives and the colors or textures assigned to those primitives by the frontend process, and draws the 2D image, determining which primitives are visible from the desired viewpoint, and based upon the displayed primitives, assigning appropriate colors to all of the pixels in the image. The output of the backend process is fed to an image buffer for display on a video display.
For a physical rendering backend, the output of the frontend process, the list of primitives and their assigned colors or textures, often must be transformed into a data structure that can be used by the physical rendering backend. In many physical rendering techniques, such as ray tracing and photon mapping, this data structure is referred to as an Accelerated Data Structure (ADS).
Given the relatively high processing requirements for physical rendering techniques, the ADS enables fast and efficient retrieval of primitives to assist in optimizing the performance of such techniques. However, while it has been found that many of the processes involved in using an ADS to perform physical rendering are capable of being accelerated via parallelization, the generation of the ADS itself has conventionally not been well suited for parallelization. In addition, many frontend processes are also well suited for parallelization. Some raster-based frontends, for example, are implemented as streaming frontends that progressively stream primitives to a raster-based backend, rather than outputting the primitives in a batch once the frontend process is completed. Consequently, while many of the frontend and backend processes associated with rendering are capable of taking advantage of parallelization to improve performance, conventional ADS generation techniques, which are not as readily suited for parallelization, may become performance bottlenecks that hamper the overall performance of a physical rendering process.
Therefore, there exists a need for more efficient techniques to perform ray tracing and other forms of physical rendering.
Another important challenge for physical rendering is the comparative lack of software support. In particular, software developers have invested a tremendous amount of effort and training in rasterization based rendering. The most commonly used Application Programming Interfaces (API's), the libraries of routines that are called by application programs to control the rendering process, such as OpenGL™ and DirectX™, are all raster-based, and presume the use of a rasterization based rendering technique.
An end-to-end physical rendering technique, on the other hand, would typically require a different API, and consequently, software developers would be required to learn and use a different API in order to support physical rendering techniques in their software applications. Beyond the added learning curve, however, additional problems are presented because new software applications are often based in large part on prior code, and furthermore, many applications are written for use on multiple hardware platforms, e.g., multiple game consoles, or are adapted from versions originally written for use on a different hardware platform. The benefit of an API is that the specifics of the underlying hardware platform are effectively hidden from the application, such that different implementations of the same API can be written for different hardware platforms, and the same generic application call to an API can be optimized for execution on different hardware platforms. Using a consistent API often enables the same application to be compiled into different executable code that can run on different hardware platforms with minimal customization for a particular hardware platform, and consequently, software developers would likely be reluctant to adopt an end-to-end physical rendering technique that requires software developers to work with a new API. Considering also that a developer may desire to use essentially the same software application on both hardware platforms that rely on raster-based rendering and hardware platforms that rely on physical rendering, the need to use a different API for physical rendering would be highly undesirable.
Therefore, a need also exists in the art for minimizing the burden on software developers wishing to utilize physical rendering techniques.